package com.meeruu.sg.account.core.api.constant;

import lombok.Getter;

/**
 * @Auther: liwu
 * @Date: 2019/5/16 16:53
 * @Description:
 */
@Getter
public enum AccountType {


    BALANCE(0, "余额账户"),
    DEPOSIT(1,"保证金账户"),
    SHOW_SCORE(2,"秀豆账户"),
    SHOW_VALUE(3,"秀值账户"),
    SELF_RETURN(4,"自返金账户"),
    HEALTH(5,"健康金账户"),
    ;
    private Integer code;
    private String desc;

    AccountType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AccountType getTypeByCode(Integer code){

        for(AccountType type:values()){
            if (type.code ==code){
                return type;
            }
        }
        return null;
    }
}
